3.4.61 \(\int \cos (c+d x) \sqrt {a+a \sec (c+d x)} (B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [361]

Optimal. Leaf size=66 \[ \frac {2 \sqrt {a} B \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {2 a C \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}} \]

[Out]

2*B*arctan(a^(1/2)*tan(d*x+c)/(a+a*sec(d*x+c))^(1/2))*a^(1/2)/d+2*a*C*tan(d*x+c)/d/(a+a*sec(d*x+c))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {4157, 4000, 3859, 209, 3877} \begin {gather*} \frac {2 \sqrt {a} B \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a \sec (c+d x)+a}}\right )}{d}+\frac {2 a C \tan (c+d x)}{d \sqrt {a \sec (c+d x)+a}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*Sqrt[a + a*Sec[c + d*x]]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(2*Sqrt[a]*B*ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a + a*Sec[c + d*x]]])/d + (2*a*C*Tan[c + d*x])/(d*Sqrt[a + a*S
ec[c + d*x]])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3859

Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(a + x^2), x], x, b*(C
ot[c + d*x]/Sqrt[a + b*Csc[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3877

Int[csc[(e_.) + (f_.)*(x_)]*Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*b*(Cot[e + f*x]/(
f*Sqrt[a + b*Csc[e + f*x]])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4000

Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Dist[c, In
t[Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[d, Int[Sqrt[a + b*Csc[e + f*x]]*Csc[e + f*x], x], x] /; FreeQ[{a, b,
 c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0]

Rule 4157

Int[((a_.) + csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(
x_)]^2*(C_.))*((c_.) + csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.), x_Symbol] :> Dist[1/b^2, Int[(a + b*Csc[e + f*x])
^(m + 1)*(c + d*Csc[e + f*x])^n*(b*B - a*C + b*C*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
 n}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0]

Rubi steps

\begin {align*} \int \cos (c+d x) \sqrt {a+a \sec (c+d x)} \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \sqrt {a+a \sec (c+d x)} (B+C \sec (c+d x)) \, dx\\ &=B \int \sqrt {a+a \sec (c+d x)} \, dx+C \int \sec (c+d x) \sqrt {a+a \sec (c+d x)} \, dx\\ &=\frac {2 a C \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}}-\frac {(2 a B) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}\\ &=\frac {2 \sqrt {a} B \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a+a \sec (c+d x)}}\right )}{d}+\frac {2 a C \tan (c+d x)}{d \sqrt {a+a \sec (c+d x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.26, size = 76, normalized size = 1.15 \begin {gather*} \frac {\sec \left (\frac {1}{2} (c+d x)\right ) \sqrt {a (1+\sec (c+d x))} \left (\sqrt {2} B \text {ArcSin}\left (\sqrt {2} \sin \left (\frac {1}{2} (c+d x)\right )\right ) \sqrt {\cos (c+d x)}+2 C \sin \left (\frac {1}{2} (c+d x)\right )\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*Sqrt[a + a*Sec[c + d*x]]*(B*Sec[c + d*x] + C*Sec[c + d*x]^2),x]

[Out]

(Sec[(c + d*x)/2]*Sqrt[a*(1 + Sec[c + d*x])]*(Sqrt[2]*B*ArcSin[Sqrt[2]*Sin[(c + d*x)/2]]*Sqrt[Cos[c + d*x]] +
2*C*Sin[(c + d*x)/2]))/d

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(117\) vs. \(2(58)=116\).
time = 13.92, size = 118, normalized size = 1.79

method result size
default \(-\frac {\sqrt {\frac {a \left (1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \left (B \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {2}}{2 \cos \left (d x +c \right )}\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )+2 C \cos \left (d x +c \right )-2 C \right )}{d \sin \left (d x +c \right )}\) \(118\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/d*(a*(1+cos(d*x+c))/cos(d*x+c))^(1/2)*(B*2^(1/2)*arctanh(1/2*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*sin(d*x+c
)/cos(d*x+c)*2^(1/2))*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*sin(d*x+c)+2*C*cos(d*x+c)-2*C)/sin(d*x+c)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 147 vs. \(2 (58) = 116\).
time = 0.54, size = 147, normalized size = 2.23 \begin {gather*} \frac {B \sqrt {a} \arctan \left ({\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \sin \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \sin \left (d x + c\right ), {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{4}} \cos \left (\frac {1}{2} \, \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) + \cos \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

B*sqrt(a)*arctan2((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/4)*sin(1/2*arctan2(sin
(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + sin(d*x + c), (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x +
 2*c) + 1)^(1/4)*cos(1/2*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 2.71, size = 235, normalized size = 3.56 \begin {gather*} \left [\frac {{\left (B \cos \left (d x + c\right ) + B\right )} \sqrt {-a} \log \left (\frac {2 \, a \cos \left (d x + c\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right ) + 1}\right ) + 2 \, C \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )}{d \cos \left (d x + c\right ) + d}, -\frac {2 \, {\left ({\left (B \cos \left (d x + c\right ) + B\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - C \sqrt {\frac {a \cos \left (d x + c\right ) + a}{\cos \left (d x + c\right )}} \sin \left (d x + c\right )\right )}}{d \cos \left (d x + c\right ) + d}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

[((B*cos(d*x + c) + B)*sqrt(-a)*log((2*a*cos(d*x + c)^2 - 2*sqrt(-a)*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*c
os(d*x + c)*sin(d*x + c) + a*cos(d*x + c) - a)/(cos(d*x + c) + 1)) + 2*C*sqrt((a*cos(d*x + c) + a)/cos(d*x + c
))*sin(d*x + c))/(d*cos(d*x + c) + d), -2*((B*cos(d*x + c) + B)*sqrt(a)*arctan(sqrt((a*cos(d*x + c) + a)/cos(d
*x + c))*cos(d*x + c)/(sqrt(a)*sin(d*x + c))) - C*sqrt((a*cos(d*x + c) + a)/cos(d*x + c))*sin(d*x + c))/(d*cos
(d*x + c) + d)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a \left (\sec {\left (c + d x \right )} + 1\right )} \left (B + C \sec {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)**2)*(a+a*sec(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(a*(sec(c + d*x) + 1))*(B + C*sec(c + d*x))*cos(c + d*x)*sec(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 193 vs. \(2 (58) = 116\).
time = 1.11, size = 193, normalized size = 2.92 \begin {gather*} -\frac {\frac {2 \, \sqrt {2} \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} C a \mathrm {sgn}\left (\cos \left (d x + c\right )\right ) \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a} + \frac {B \sqrt {-a} a \log \left (\frac {{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}{{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} + 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}\right ) \mathrm {sgn}\left (\cos \left (d x + c\right )\right )}{{\left | a \right |}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(B*sec(d*x+c)+C*sec(d*x+c)^2)*(a+a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

-(2*sqrt(2)*sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a)*C*a*sgn(cos(d*x + c))*tan(1/2*d*x + 1/2*c)/(a*tan(1/2*d*x + 1/
2*c)^2 - a) + B*sqrt(-a)*a*log(abs(2*(sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a))^2 -
 4*sqrt(2)*abs(a) - 6*a)/abs(2*(sqrt(-a)*tan(1/2*d*x + 1/2*c) - sqrt(-a*tan(1/2*d*x + 1/2*c)^2 + a))^2 + 4*sqr
t(2)*abs(a) - 6*a))*sgn(cos(d*x + c))/abs(a))/d

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \cos \left (c+d\,x\right )\,\left (\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right )\,\sqrt {a+\frac {a}{\cos \left (c+d\,x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(B/cos(c + d*x) + C/cos(c + d*x)^2)*(a + a/cos(c + d*x))^(1/2),x)

[Out]

int(cos(c + d*x)*(B/cos(c + d*x) + C/cos(c + d*x)^2)*(a + a/cos(c + d*x))^(1/2), x)

________________________________________________________________________________________